﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ESoft.Job
{
    /// <summary>
    /// 任务服务类
    /// </summary>
    public interface IJobService
    {
        /// <summary>
        /// 添加任务
        /// </summary>
        /// <param name="job"></param>
        /// <param name="cron"></param>
        /// <returns></returns>
        Task AddJobAsync(IJob job, string cron);

        /// <summary>
        /// 启动任务
        /// </summary>
        /// <param name="jobs"></param>
        /// <param name="assemblies"></param>
        void StartupJobs(IEnumerable<IJob> jobs, Assembly[] assemblies);
    }
}
